package com.qlshouyu.len43;

import com.qlshouyu.len43.servlet.TestServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * TODO
 *
 * @author 高露 邮箱：<a href="egojit@qq.com">egojit@qq.com</a>
 * @since 2019-11-02 07:54
 */
@Configuration
public class ServletConfiguration {

    @Bean
    public ServletRegistrationBean servletRegistrationBean() {
        ServletRegistrationBean bean = new ServletRegistrationBean(new TestServlet());
        //放入自己的Servlet对象实例
        bean.addUrlMappings("/secondServlet");  //访问路径值
        bean.addUrlMappings("/secondServlet/test");  //访问路径值
        return bean;
    }
}
